<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/kaoqin.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css"/>
</block>
<block name="content" >
    <section class="layui-larry-box mian-page page-attendanceStatistics page-jixiao">
	<!--第一部分-->
	<div class="row">
            <div class="col-lg-12 col-sm-12">
                <blockquote class="layui-elem-quote news_search">
                    <form class="layui-form" method="get">
                        <if condition='$leader eq 2'>
                            <div class="layui-row marginB20">
                                <div class="layui-inline">按部门：</div>
                                <ul class="layui-inline bumenList dept">
                                    <li class="layui-inline {$deptId?'':'active'}">全部</li>
                                    <foreach name="depts" item="dept">
                                        <li class="layui-inline {$deptId == $dept['dept_id']?'active':''}" data-id='{$dept.dept_id}'>{$dept.dept_name}</li>
                                    </foreach>
                                </ul>

                            </div>
                        </if>
                        <div class="layui-row timeBox">
                            <div class="layui-inline">按时间：</div>
                            <ul class="layui-inline timeList">
                                <li class="layui-inline first">
                                    <select name="year" id="year" class="layui-input search_input">
                                        <foreach name="yearArr" item="year" >
                                            <option value="{$year}" {$chooseyear == $year ? 'selected' : ''}>{$year}年</option>
                                        </foreach>
                                    </select>
                                </li>
                                <li class="layui-inline {$month == 1?'active':''} {$curMonth == 1?'active':''}">1月</li>
                                <li class="layui-inline {$month == 2?'active':''} {$curMonth == 2?'active':''}">2月</li>
                                <li class="layui-inline {$month == 3?'active':''} {$curMonth == 3?'active':''}">3月</li>
                                <li class="layui-inline {$month == 4?'active':''} {$curMonth == 4?'active':''}">4月</li>
                                <li class="layui-inline {$month == 5?'active':''} {$curMonth == 5?'active':''}">5月</li>
                                <li class="layui-inline {$month == 6?'active':''} {$curMonth == 6?'active':''}">6月</li>
                                <li class="layui-inline {$month == 7?'active':''} {$curMonth == 7?'active':''}">7月</li>
                                <li class="layui-inline {$month == 8?'active':''} {$curMonth == 8?'active':''}">8月</li>
                                <li class="layui-inline {$month == 9?'active':''} {$curMonth == 9?'active':''}">9月</li>
                                <li class="layui-inline {$month == 10?'active':''} {$curMonth == 10?'active':''}">10月</li>
                                <li class="layui-inline {$month == 11?'active':''} {$curMonth == 11?'active':''}">11月</li>
                                <li class="layui-inline {$month == 12?'active':''} {$curMonth == 12?'active':''}">12月</li>
                            </ul>
                            <button class="layui-btn search-btn search" style="margin-bottom: 10px;">查询</button>
                        </div>
                    </form>
                </blockquote>
                <div class="jixiao_main">
                    <div class="arrowWrap" state="show"><img src="/Public/Admin/images/arrow_up.png" /></div>
                    <div class="exportWrap export">
                        <img src="/Public/Admin/images/export.png" /><span>导出</span>
                    </div>
                    <table class="layui-table" lay-skin="line">
                        <thead>
                            <tr>
                                <th rowspan="2" class="bg1 borderR">序号</th>
                                <th rowspan="2" class="bg1 borderR">部门</th>
                                <th rowspan="2" class="bg1 borderR">人员</th>
                                <th colspan="5" class="bg2 bg2BorderB">计划执行情况</th>
                                <th colspan="5" class="bg3 bg3BorderB">出勤情况</th>
                            </tr>
                            <tr>
                                <th class="bg2">公司级计划数</th>
                                <th class="bg2">未完成计划数</th>
                                <th class="bg2">标的物缺失数</th>
                                <th class="bg2">进度欠报次数</th>
                                <th class="bg2">个人计划数</th>
                                <th class="bg3">迟到次数</th>
                                <th class="bg3">早退次数</th>
                                <th class="bg3">出差天数</th>
                                <th class="bg3">请假天数</th>
                                <th class="bg3">加班时长</th>
                            </tr>
                        </thead>
                        <tbody>
                            <notempty>
                                <foreach name='users' item='data' key='key'>
                                    <tr>
                                        <td class="borderR">{$data.num}</td>
                                        <td class="borderR">{$data.dept_name}</td>
                                        <td class="borderR">{$data.user_name}</td>
                                        <td>
                                            <a style="color:#1781d0;" href='{:U("Plan/index",array("user_id"=>$data["user_id"],"level"=>2,"sms_flag"=>"2","start"=>$date1,"end"=>$date2,"date"=>$date))}'>
                                                {$data.companyPlan}
                                            </a>
                                        </td>
                                        <td>
                                            <a style="color:#1781d0;" href='{:U("Plan/index",array("user_id"=>$data["user_id"],"sms_flag"=>"0","start"=>$date1,"end"=>$date2,"date"=>$date))}'>
                                                {$data.noFinish}
                                            </a>
                                        </td>
                                        <td>{$data.lostFile}</td>
                                        <td>{$data.noDetail}</td>
                                        <td class="borderR">
                                            <a style="color:#1781d0;" href='{:U("Plan/index",array("user_id"=>$data["user_id"],"level"=>1,"sms_flag"=>"2","start"=>$date1,"end"=>$date2,"date"=>$date))}'>
                                                {$data.uPlan}
                                            </a>
                                        </td>
                                        <td>{$data.late}</td>
                                        <td>{$data.early}</td>
                                        <td>{$data.evection}</td>
                                        <td>{$data.leave}</td>
                                        <td>{$data.overtime}</td>
                                    </tr>
                                </foreach>
                            </notempty>
                        </tbody>
                    </table>
                    <div class="layui-block">共{$count}条数据</div>
                    <div class="larry-table-page clearfix">
                        <input type='hidden' id="followUrl" value="{:U('attentPlan')}">
                        <!--<a href="javascript:;" class="layui-btn layui-btn-small"><i class="iconfont icon-shanchu1"></i>删除</a>-->
                        <div id="page" class="page">{$page}</div>
                    </div>
                </div>
            </div>
	</div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/attend.js"></script>
    <script type="text/javascript">
        $(initAttend());
//        layui.use(['jquery','layer','element','form'],function(){
//		window.jQuery = window.$ = layui.jquery;
//		window.layer = layui.layer;
//        window.element = layui.element();
//        var form = layui.form();
//        var para = location.search.substring(1);//获取查询串 
//        para = para.substring(16)+'月';
//        $('.timeList li').each(function(){
//            if($(this).text() == para){
//                $(this).addClass("active");
//            }
//        })
        
        $(document).on("click",".timeList li",function(){
            if($(this).attr('class').indexOf('active')){
                $(this).addClass("active").siblings().removeClass("active");
            }else{
                $(this).addClass("active");
            }
            
        });
        $(document).on("click",".bumenList li",function(){
            $(this).addClass("active").siblings().removeClass("active");
        });
        $(document).on("click",".arrowWrap",function(){
            var flag = $(this).attr("state");
            if(flag == "show"){
                $(this).find("img").attr("src","/Public/Admin/images/arrow_down.png");
                $(this).attr("state","hide");
                $(".timeBox").hide();

            }else if(flag == "hide"){
                $(this).find("img").attr("src","/Public/Admin/images/arrow_up.png");
                $(this).attr("state","show");
                $(".timeBox").show();
            }
        });
    </script>
</block>